﻿using NUnit.Framework;
using Smartkernel.Security.Cryptography;
using System.Text;

namespace Smartkernel.NUnitTest.Security.Cryptography
{
    [Category("Security.Cryptography")]
    [TestFixture]
    public class SmartCryptographyTest
    {
        [Test]
        public void Test()
        {
            //【01】加密解密的测试（涉及方法：Encrypt、Decrypt）
            string input = @"aasas2173819238921asdjKJHJHHsadsadC:\asdsa></./";
            string password = "12345678";
            string output = SmartCryptography.Encrypt(input, "12344321");
            Assert.AreEqual(SmartCryptography.Decrypt(output, "12344321"), input);

            output = SmartCryptography.Encrypt(input, "12344321", Encoding.GetEncoding("gb2312"));
            Assert.AreEqual(SmartCryptography.Decrypt(output, "12344321", Encoding.GetEncoding("gb2312")), input);
        }
    }
}
